<?php
/****************************************************************************

	COPYRIGHT(C) WWW.MAXSI.DK, MAXSI SOFTWARE, SORTIE 2009
	ALL RIGHTS RESERVED

	Maxsi Distribution Shared/ Branch
	Scripts shared by the MasterServer/ and ContentServer/ Branch of the Maxsi
	Distribution Server-Side Code Branches.
	
	init.php
	Includes all Maxsi Distribution header files.

****************************************************************************/

include('addons/shared/defines.php');
include('addons/shared/quote.php');
include('addons/shared/MaxsiDataContainer.php');
include('addons/shared/MaxsiActionClass.php');
include('addons/shared/MaxsiInstallScript2.php');
include('addons/shared/timesystem.php');
include('addons/shared/database.php');
include('addons/shared/account.php');
include('addons/shared/bandwidth.php');
include('addons/shared/addon_sys.php');

// Todo: move the following to the appropriate places.

function md_GetContentServerURL()
{
	return 'http://'.$_SERVER['HTTP_HOST'].str_replace("index.php","",$_SERVER['PHP_SELF']);
}
function md_GetContentServerName()
{
	return	md_GetContentServerURL();
}
function md_GetOutputType()
{
	$OutputType		=	md_RequestParam('OutputType');
	
	if	(!isset($OutputType)) { return ''; }
	return	$_GET['OutputType'];
}

function md_IsOutputMDC()
{
	$OutputType		=	md_RequestParam('OutputType');
	
	if	(!isset($OutputType)) { return false; }
	return (strcasecmp(md_GetOutputType(),'Application/x-MaxsiDataContainer')==0);
}

function md_IsOutputHTML()
{
	$OutputType		=	md_RequestParam('OutputType');
	
	if	(!isset($OutputType)) { return true; }	// Default to text/html
	return (strcasecmp(md_GetOutputType(),'text/html')==0);
}
?>